<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script src="https://cdn.bootcdn.net/ajax/libs/axios/1.3.6/axios.js"></script>

  <script>
    axios({
      url: 'http://hmajax.itheima.net/api/province'
    }).then(res => {
      console.log(res, 111);
      /* 省的数据获取之后才可以获取市 */
      axios({
        url: 'http://hmajax.itheima.net/api/city',
        params: {
          pname: '湖北省'
        }
      }).then(res2 => {
        console.log(res2, 222);
        /* 获取区 */
        axios({
          url: 'http://hmajax.itheima.net/api/area',
          params: {
            pname: '湖北省',
            cname: '武汉市'
          }
        }).then(res3 => {
          console.log(res3, 3333);
        })
      })
    })
  </script>
</body>

</html>